package main

import "fmt"

/* 2236. 判断根结点是否等于子结点之和  https://leetcode.cn/problems/root-equals-sum-of-children/*/

func ExecQ2236() {
	root := &TreeNode{
		Val:   10,
		Left:  &TreeNode{Val: 4},
		Right: &TreeNode{Val: 6},
	}
	fmt.Println(checkTree(root))
}

// 我写的
func checkTree(root *TreeNode) bool {

	return root.Val == root.Left.Val+root.Right.Val
}
